//:C14:Composition.cpp
// Reuse code with composition
#include "Useful.h"

class Y
{
    int i;
    public:
        X x;    // Embedded object
        Y(){ i = 0; }
        void f(int ii) { i = ii; }
        int g() const { return i; }
};

int main(void)
{
    Y y;
    y.f(47);
    y.x.set(37);    // Access the embedded object                    
}
